package org.wannatrak.android.activity;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import org.wannatrak.android.R;

import java.util.Locale;

/**
 * @Author: Maksim Tulupov maxtulupov@gmail.com
 * @Date: $Date: 2011-11-27 15:19:37 +0000 (Sun, 27 Nov 2011) $ 10:10 AM
 * @version: $Revision: 31 $
 * @id: $Id: AbstractContextMenuActivity.java 31 2011-11-27 15:19:37Z maxtulupov@gmail.com $
 */
public abstract class AbstractContextMenuActivity extends Activity {

    public final static String HELP_URL = "http://www.google.com?locale=";

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.context_menu, menu);
        return true;
    }

    public void openHelp() {
        Intent i = new Intent(this, HelpActivity.class);
        startActivity(i);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.help:
                openHelp();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }
}
